package com.zycfc.zsf.boot.logback.core;

import java.io.*;
import com.zycfc.zsf.boot.logback.consts.*;
import com.zycfc.zsf.boot.util.net.NetUtils;
import com.zycfc.zsf.boot.util.text.StringUtils;

public class ApiTranInf implements Serializable
{
    private static final long serialVersionUID = 1L;
    private String reqIp;
    private int reqPort;
    private String path;
    private String method;
    private String requestJson;
    private String responseJson;
    private long exeTm;
    private String exeIp;
    private String exeSts;
    private String respCode;
    private String respMsg;
    private String emplyNo;
    private String emplyName;
    private String grayscaleFlag;
    
    public ApiTranInf(final String reqIp, final int reqPort, final String path, final String method, final String requestJson, final String responseJson, final long exeTm, final String exeSts) {
        this.reqIp = reqIp;
        this.reqPort = reqPort;
        this.path = path;
        this.method = method;
        this.requestJson = requestJson;
        this.responseJson = responseJson;
        this.exeTm = exeTm;
        this.exeSts = (StringUtils.isEmpty(exeSts) ? "S" : exeSts);
    }
    
    @Override
    public String toString() {
        return LogTypeEnum.CHAIN + "@@@" + this.reqIp + "#@%@#" + this.reqPort + "#@%@#" + this.path + "#@%@#" + this.method + "#@%@#" + this.requestJson + "#@%@#" + this.responseJson + "#@%@#" + this.exeTm + "#@%@#" + NetUtils.getLocalHostIp() + "#@%@#" + this.exeSts + "#@%@#" + this.respCode + "#@%@#" + this.respMsg + "#@%@#" + this.emplyNo + "#@%@#" + this.emplyName + "#@%@#" + this.grayscaleFlag;
    }
    
    public void setReqIp(final String reqIp) {
        this.reqIp = reqIp;
    }
    
    public void setReqPort(final int reqPort) {
        this.reqPort = reqPort;
    }
    
    public void setPath(final String path) {
        this.path = path;
    }
    
    public void setMethod(final String method) {
        this.method = method;
    }
    
    public void setRequestJson(final String requestJson) {
        this.requestJson = requestJson;
    }
    
    public void setResponseJson(final String responseJson) {
        this.responseJson = responseJson;
    }
    
    public void setExeTm(final long exeTm) {
        this.exeTm = exeTm;
    }
    
    public void setExeIp(final String exeIp) {
        this.exeIp = exeIp;
    }
    
    public void setExeSts(final String exeSts) {
        this.exeSts = exeSts;
    }
    
    public void setRespCode(final String respCode) {
        this.respCode = respCode;
    }
    
    public void setRespMsg(final String respMsg) {
        this.respMsg = respMsg;
    }
    
    public void setEmplyNo(final String emplyNo) {
        this.emplyNo = emplyNo;
    }
    
    public void setEmplyName(final String emplyName) {
        this.emplyName = emplyName;
    }
    
    public void setGrayscaleFlag(final String grayscaleFlag) {
        this.grayscaleFlag = grayscaleFlag;
    }
    
    public String getReqIp() {
        return this.reqIp;
    }
    
    public int getReqPort() {
        return this.reqPort;
    }
    
    public String getPath() {
        return this.path;
    }
    
    public String getMethod() {
        return this.method;
    }
    
    public String getRequestJson() {
        return this.requestJson;
    }
    
    public String getResponseJson() {
        return this.responseJson;
    }
    
    public long getExeTm() {
        return this.exeTm;
    }
    
    public String getExeIp() {
        return this.exeIp;
    }
    
    public String getExeSts() {
        return this.exeSts;
    }
    
    public String getRespCode() {
        return this.respCode;
    }
    
    public String getRespMsg() {
        return this.respMsg;
    }
    
    public String getEmplyNo() {
        return this.emplyNo;
    }
    
    public String getEmplyName() {
        return this.emplyName;
    }
    
    public String getGrayscaleFlag() {
        return this.grayscaleFlag;
    }
}
